home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: Nov 4, 1999
- //
- // Procedure:
- // subdFindPolyForHierMode
- //
- // Description:
- // Given a subdivision surface (with construction history),
- // return the name of the upstream polygon used when in
- // "polygon proxy" mode.
- //
- global proc string subdFindProxyModePolygon( string $subd )
- {
- string $result = "";
-
- // Ordinarilly, this would be called with a subdivision surface as
- // $subd. However, dagMenuProc.mel may call it with a transform
- // above it instead, so we do a filterExpand, just in case.
- //
- global int $gSelectSubdivSurface;
- string $list[]=`filterExpand -ex 1 -fp 1 -sm $gSelectSubdivSurface $subd`;
- int $len = size($list);
- if( $len > 0 ) {
- $subd = $list[0];
- }
-
- // If we're not in polygon mode, no point in looking
- // for the polygon proxy.
- //
- int $whichMode = `subdiv -q -proxyMode $subd`;
- if( 1 != $whichMode ) {
- error( $subd + ": subdivision surface is not in polygon mode." );
- return $result;
- }
-
- string $hist[] = `listHistory $subd`;
- for( $histNode in $hist ) {
- if( "mesh" == `nodeType $histNode` ) {
- $result = $histNode;
- break;
- }
- }
-
- return $result;
- }
-